package com.hpxx.ylzswl.dialog;

import android.content.Context;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;

import com.google.zxing.WriterException;
import com.hpxx.ylzswl.R;
import com.hpxx.ylzswl.utils.EncodingHandler;


/**
 * 退出登录
 * @author Administrator
 */
public class ErWeiMaDialog extends BaseDialog {

	private String text;
	private String ewm;
	public ErWeiMaDialog(Context context) {
		super(context);
		this.context = context;
	}

	public ErWeiMaDialog(Context context, String text,String ewm, int theme, LeaveMyDialogListener listener) {
		super(context, theme,listener);
		this.context = context;
		this.listener = listener;
		this.text = text;
		this.ewm = ewm;
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.dialog_erweima);
		TextView tv_content = (TextView) findViewById(R.id.tv_content);
		ImageView iv_ewm = (ImageView)findViewById(R.id.iv_ewm);
		ImageView iv_close = (ImageView)findViewById(R.id.iv_close);
		iv_close.setOnClickListener(this);
		try {
			Bitmap qrCodeBitmap = EncodingHandler.createQRCode(ewm, 500);
			iv_ewm.setImageBitmap(qrCodeBitmap);
		} catch (WriterException e) {
			e.printStackTrace();
		}
		tv_content.setText(text);

	}

}